#include <ros/ros.h>
#include <std_msgs/Float64.h>

void sinCallBack(const std_msgs::Float64 & msg)
{
    ROS_INFO("received data:%lf \n",msg.data);
}


int main(int argc, char ** argv)
{
    ros::init(argc,argv,"my_sub");
    ros::NodeHandle nh;
    ros::Subscriber my_sub = nh.subscribe("topic1",1,sinCallBack);
    ros::spin();
    return 0;
}